﻿<%@ Page Language="C#" Title="大修方案结果表" MasterPageFile="~/W_View/PageMaster.Master" CodeBehind="Dr_RepairLar.aspx.cs" Inherits="STHPMS1.Web.W_View.Decision.Repair.Dr_RepairLar" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/datagrid.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/dropdown.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/Jquery/ajaxfileupload.js")%>
     <%= UiHelper.RefJsFileHtml("/Scripts/TypeScript/Appearance.js")%>
    <script type="text/javascript">

        var _css = new Appearance();
        //查询
        function search(n, o) {
            var anniname = $('#cmbAnniName').combobox("getValue");
            var analy_year = $('#cmbAnaly_Year').combobox("getValue");
            //console.log(analy_year);
            var url = '/api/repairlar';
            var urlParam = "";
            if (anniname != "" && anniname != "0") urlParam += "anniname=" + encodeURI(anniname) + "&";
            if (analy_year != "" && analy_year != "0") urlParam += "analy_year=" + encodeURI(analy_year) + "&";
            if (urlParam != "") {
                urlParam = "?" + urlParam.substring(0, urlParam.length - 1);
                url = url + urlParam;
            }

            $('#dg').datagrid({ url: url, pageNumber: 1 });
        }

        //提取主要病害
        function Insert() {
            var anniname = $('#cmbAnniName').combobox("getValue");
            var analy_year = $('#cmbAnaly_Year').combobox("getValue");
            if (!anniname && !analy_year) {
                $.messager.alert('消息提示', '请选择资金模型名称和分析年度！', 'warning');
                return;
            }

            $.ajax({
                url: "/api/repairlar/insert?anniname=" + anniname + "&analy_year=" + analy_year + "",
                type: "GET",
                success: function () {
                    $.messager.alert('成功', '大修方案设计成功!', "info");
                    $('#dg').datagrid({ url: '/api/repairlar', pageNumber: 1 });
                },
                error: function (err) {
                    $.messager.alert('错误提示', '大修方案设计失败！ -' + err, "error");
                }
            });

        }

        $(function () {
            var number = '<%= Page.RouteData.Values["page"] %>';
            var size = '<%= Page.RouteData.Values["size"] %>';

            loadAdmDiv();
            dataGridBind($('#dg'), '/api/repairlar', '大修方案列表', $('#tb'), number, size);
        })

    </script>    

    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table id="dg" class="easyui-datagrid content-place"  ajaxCached="false"  >
        <thead>
            <th data-options="field:'Analy_Year',editor:'text',width:100,align:'right' ">分析年度</th>
            <th data-options="field:'Rdwayid',editor:'text',width:100,align:'right' ">路线编号</th>
            <%--<th data-options="field:'MainSegid',editor:'text',width:200,align:'right' ">养护路段</th>--%>
            <th data-options="field:'Beginmp',editor:'text',width:100,align:'right' ,formatter:_css.formatStake">起点桩号</th>
            <th data-options="field:'Endmp',editor:'text',width:100,align:'right' ,formatter:_css.formatStake">终点桩号</th>
            <th data-options="field:'Up_StruName',editor:'text',width:100,align:'right' " >上面层材料</th>
            <th data-options="field:'Up_Thick',editor:'text',width:100,align:'right' " >上面层厚度(cm)</th>

            <th data-options="field:'Mid_StruName',editor:'text',width:100,align:'right' " >中面层材料</th>
            <th data-options="field:'Mid_Thick',editor:'text',width:100,align:'right' " >中面层厚度(cm)</th>

            <th data-options="field:'Mid_StruName',editor:'text',width:100,align:'right' " >下面层材料</th>
            <th data-options="field:'Mid_Thick',editor:'text',width:100,align:'right' " >下面层厚度(cm)</th>

            <th data-options="field:'Mid_StruName',editor:'text',width:100,align:'right' " >基层材料</th>
            <th data-options="field:'Mid_Thick',editor:'text',width:100,align:'right' " >基层厚度(cm)</th>

            <th data-options="field:'Mid_StruName',editor:'text',width:100,align:'right' " >底基层材料</th>
            <th data-options="field:'Mid_Thick',editor:'text',width:100,align:'right' " >底基层厚度(cm)</th>
            
            <th data-options="field:'Cost',editor:'text',width:100,align:'right' " >总费用(万元)</th>
        </thead>
    </table>
   
    <div id="tb">
      
         <select id="cmbAnniName" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'资金模型名称',url:'/api/dfcostmodpara/anniname',method:'get',valueField:'id',textField:'id'">
         </select>

         <select id="cmbAnaly_Year" class="easyui-combobox" name="cmbAnaly_Year" data-options="prompt:'分析年度',onChange:search" style="width:100px;">   
            <option value="2015">2015年</option>   
            <option value="2016">2016年</option>   
            <option value="2017">2017年</option>   
            <option value="2018">2018年</option>   
            <option value="2019">2019年</option>   
        </select>  
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="Insert()">大修方案设计</a>
      
     
    </div>

    

    
</asp:Content>
